package cn.buaa.anniversary.msg;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Objects;

/**
 * Created this one by HMH on 2017/5/12.
 * 返回的文件消息
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class FileMessage extends BaseMessage {

    private String url;
    private String fileName;

    public FileMessage(String errmsg, String errcode, String url, String fileName) {
        super(errmsg, errcode);
        this.url = url;
        this.fileName = fileName;
    }

    //    简单设置一下错误代码。。毕竟只有一个页面
    public FileMessage(String type){
        if (Objects.equals(type, "error")) {
            this.setErrcode("500");
            this.setErrmsg("error");
        }
    }
    //    简单设置一下错误代码。。毕竟只有一个页面
    public FileMessage(String type,String msg){
        if (Objects.equals(type, "error")) {
            this.setErrcode("500");
            this.setErrmsg(msg);
        }
    }



}
